-- GENERATED SPELL FOR [Greyheart Nether-Mage] --


function spell0_21230(pUnit, Event) --@Arcane Destruction,n/a--
pUnit:FullCastSpellOnTarget(38647,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 607, 1)
end

function spell1_21230(pUnit, Event) --@Arcane Lightning,n/a--
pUnit:FullCastSpellOnTarget(38634,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 4318, 1)
end

function spell2_21230(pUnit, Event) --@Arcane Volley,n/a--
pUnit:FullCastSpellOnTarget(38633,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 613, 1)
end

function spell3_21230(pUnit, Event) --@Blink,Self--
pUnit:FullCastSpellOnTarget(38642,pUnit)
pUnit:RegisterEvent('Sorts_21230', 632, 1)
end

function spell4_21230(pUnit, Event) --@Cone of Cold,Self--
pUnit:FullCastSpellOnTarget(38644,pUnit)
pUnit:RegisterEvent('Sorts_21230', 12327, 1)
end

function spell5_21230(pUnit, Event) --@Fire Destruction,n/a--
pUnit:FullCastSpellOnTarget(38648,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 612, 1)
end

function spell6_21230(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(38641,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 515, 1)
end

function spell7_21230(pUnit, Event) --@Frost Destruction,n/a--
pUnit:FullCastSpellOnTarget(38649,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 630, 1)
end

function spell8_21230(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(38645,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 4330, 1)
end

function spell9_21230(pUnit, Event) --@Rain of Fire,n/a--
pUnit:FullCastSpellOnTarget(38635,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 6000, 1)
end

function spell10_21230(pUnit, Event) --@Scorch,n/a--
pUnit:FullCastSpellOnTarget(38636,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21230', 529, 1)
end

function Sorts_21230(pUnit, Event)
local choix_sorts_21230 = math.random(0, 10)
if choix_sorts_21230 == 0 then
pUnit:RegisterEvent('spell0_21230', 1, 1)
end
if choix_sorts_21230 == 1 then
pUnit:RegisterEvent('spell1_21230', 1, 1)
end
if choix_sorts_21230 == 2 then
pUnit:RegisterEvent('spell2_21230', 1, 1)
end
if choix_sorts_21230 == 3 then
pUnit:RegisterEvent('spell3_21230', 1, 1)
end
if choix_sorts_21230 == 4 then
pUnit:RegisterEvent('spell4_21230', 1, 1)
end
if choix_sorts_21230 == 5 then
pUnit:RegisterEvent('spell5_21230', 1, 1)
end
if choix_sorts_21230 == 6 then
pUnit:RegisterEvent('spell6_21230', 1, 1)
end
if choix_sorts_21230 == 7 then
pUnit:RegisterEvent('spell7_21230', 1, 1)
end
if choix_sorts_21230 == 8 then
pUnit:RegisterEvent('spell8_21230', 1, 1)
end
if choix_sorts_21230 == 9 then
pUnit:RegisterEvent('spell9_21230', 1, 1)
end
if choix_sorts_21230 == 10 then
pUnit:RegisterEvent('spell10_21230', 1, 1)
end
end

function mob21230_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21230', math.random(1500, 3000), 1)
end

function mob21230_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21230_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21230_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21230, 1, 'mob21230_Action')
RegisterUnitEvent(21230, 2, 'mob21230_Leave')
RegisterUnitEvent(21230, 3, 'mob21230_Kill')
RegisterUnitEvent(21230, 4, 'mob21230_Die')
